﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Threading.Tasks;
using System.Data.SqlClient;
using DAL;


namespace BLL
{
    public class ForBorrowAndReturn
    {
        public SqlDataAdapter SeeCanBorrow(int StateID)
        {
            //查询可借图书信息语句
            string sql = @"select BookID,BookName,Author,Press,Words,BookType,ClassName,Price,State 
                        from Books,Book,BookType,BookClass,BookState 
                        where Books.ID = Book.ID and Book.BookTypeID = BookType.BookTypeID 
                        and Book.ClassID = BookClass.ClassID and BookState.StateID = Books.StateID
                        and Books.StateID = " + StateID;
            SqlDataAdapter adapter = new SqlDataAdapter(sql, DBHelper.Connection);
            return adapter;
        }
    }
}
